#ifndef _SAMPLE_INSTANCE_H_
#define _SAMPLE_INSTANCE_H_

#include <logging/log.h>

/* 1. 在实例结构中用LOG_INSTANCE_PTR_DECLARE指定日志的结构 */
struct sample_instance {
	LOG_INSTANCE_PTR_DECLARE(log);
	uint32_t cnt;
};



static inline void sample_instance_header_do(struct sample_instance *inst)
{
	LOG_LEVEL_SET(LOG_LEVEL_INF);
	LOG_INST_INF(inst->log, "inst %p header do %d.", inst, inst->cnt);
	inst->cnt++;
}

struct sample_instance *sample_instance_open(uint8_t id);
int sample_instance_close(struct sample_instance *inst);
int sample_instance_do(struct sample_instance *inst);


#endif  /* _SAMPLE_INSTANCE_H_ */